package com.mapper;

import com.domain.Admin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AdminMapper {
    // 根据ID查询后台用户
    @Select("SELECT * FROM t_admin WHERE id = #{id}")
    public Admin findById(Integer id);

    @Insert("INSERT INTO t_admin(admin_name, pwd, phone) Values (#{adminName}, #{pwd}, #{phone})")
    public int insertUser(Admin user);

    @Select("SELECT * FROM t_admin WHERE admin_name = #{adminName} and pwd = #{pwd}")
    public Admin userLogin(Admin user);
}